# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
===========================
@Time : 2022/8/15 0015 21:49
@Author : 测试开发工程师
@File : 4. Kibana.py
@Software: PyCharm
============================
"""


"""
Kibana
ElasticSearch 的官方前端，数据探索分析与图表制作平台

Kibana介绍：
    Kibana部署 ： docker run -d --name kibana -p 5601:5601 -e "ELASTICSEARCH_HOSTS=http://h2.stug.ceshiren.com:9200"
                  docker.elastic.co/kibana/kibana:7.14.0
    
Kibana配置：
    Index Management
    Index patterns
    
discover 数据探索

KQL数据查询：
    Terms Query:
        http.response.stauts_code: 400 401 404
        http.response.body.content.text:quick brown fox-
        http.response.body.content.text:"quick brown fox"
    Boolean Query:
        response : 200 or extension:php response:(200 or 404)
        response : 200 and not (extension:php or extension:css)
    Range Query:
        account_number >= 100 and items_sold <= 200
        @timestamp < "2021-01-02T21:55:59" @timestamp < '2021-01'
    Wildcard Query machine.os:win * machine.os*: windows 10
    
KQL 嵌套字段查询
    Nested Query
        items:{name:banana and stock > 10}
        items : {name:banana} and items:{stock:9}
        leve11.leve12:{propl:foo and prop2:bar}

Apache 的 Lucene query
    字段查询： status : active title:{quick OR brown} author:'John Smith' first name:Alice
    通配符使用 qu?ck bro*
    正则表达式： name: /joh?n[ath(oa|n])
    range: 
        count:[1 TO 5]
        date : [2021-01-01 TO 2012-12-31]
        count: [10 TO *]date:{* TO 2012-01-01} count:{1 TO 5}
    Boolean((quick AND fox)) OR (brown AND fox) OR fox) AND NOT news
    
visualize library 可视化库
Lens
TSVB Time Series Visual Builder
Vega
Aggregation-based   聚合分析图特点
canvas   
maps  
graph
Machine learning


                 


"""